package com.dhcc.DRGsHosp.facade.impl.quartzjob;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import com.dhcc.DRGsHosp.core.domain.ScheduleJob;
import com.dhcc.DRGsHosp.facade.SumExpenseFacade;

/**
 * 	@Discription：定时计算费用中间表数据
 *  @Author QiaoYiLong  
 *  @Date: 2019年02月13日 9:18:07  
 */
public class SumExpenseFacadeQuartzJob implements Job {
	@Autowired
	SumExpenseFacade sumExpenseFacade ;
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
		String param = scheduleJob.getJobData();
		if(null != param && !"".equals(param) && param.split("_").length >= 3){
			String datas[] = param.split("_");
			String dateFrom = datas[0];
			String dateTo = datas[1];
			String dateType = datas[2];
			sumExpenseFacade.sumExpense(dateFrom, dateTo, dateType);		
		}
	}

}
